import type { ParamsTypeType } from '#/views/system/params/params.data.ts';

import { requestClient } from '#/api/request';

export namespace SysParamsTypeTableApi {
  export type RowTypeFetchParams = ParamsTypeType;
  export interface IdFetchParams {
    id: string;
  }
  export interface ListFetchParams {
    [key: string]: any;
  }
  export interface PageListFetchParams {
    [key: string]: any;
    pageNo: number;
    pageSize: number;
  }
}

/**
 * 分页列表查询
 */
export async function sysParamsTypeQueryPageListApi(
  params: SysParamsTypeTableApi.PageListFetchParams,
) {
  return requestClient.get('/system/sysParamsType/queryPageList', { params });
}

/**
 * 列表查询
 */
export async function sysParamsTypeQueryListApi(
  params: SysParamsTypeTableApi.ListFetchParams,
) {
  return requestClient.get('/system/sysParamsType/queryList', { params });
}

/**
 * 通过ID查询
 * @param params
 */
export async function sysParamsTypeQueryByIdApi(
  params: SysParamsTypeTableApi.IdFetchParams,
) {
  return requestClient.get('/system/sysParamsType/queryById', { params });
}

/**
 * 新增
 */
export async function sysParamsTypeAddApi(
  params: SysParamsTypeTableApi.RowTypeFetchParams,
) {
  return requestClient.post('/system/sysParamsType/add', params);
}

/**
 * 编辑
 */
export async function sysParamsTypeEditApi(
  params: SysParamsTypeTableApi.RowTypeFetchParams,
) {
  return requestClient.post('/system/sysParamsType/edit', params);
}

/**
 * 删除
 * @param id 主键
 */
export async function sysParamsTypeDelApi(id) {
  return requestClient.delete<boolean>(`/system/sysParamsType/delete/${id}`);
}

/**
 * 批量删除删除
 * @param ids 主键
 */
export async function sysParamsTypeDeleteBatchApi(ids) {
  return requestClient.delete<boolean>(
    `/system/sysParamsType/deleteBatchByIds/${ids}`,
  );
}

/**
 * 刷新缓存
 */
export async function sysParamsTypeRefreshCacheApi() {
  return requestClient.get('/system/sysParamsType/refreshCache');
}
